<%@ page language="java" pageEncoding="UTF-8"%><%@ include
	file="/WEB-INF/commons/taglibs.jsp"%>
<!-- 如果session中用户名为空，跳转到登录页面 -->
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>
<%
	UserService userService = UserServiceFactory.getUserService();
	User user = userService.getCurrentUser();
	if (user == null) {
		response.sendRedirect(userService.createLoginURL("/settings"));
	}
%>
<script type="text/javascript">
	$(function(){
		$('#save-settings').click(function(){alert('save now');});
		$('#cacel-settings').click(function(){window.location.href='/home';});
	});
</script>
<table>
	<tr>
		<td>
		<div id="left" class="top-border">
		<form name="settingForm" action="/settings" method="POST">
		<p class="title">设置</p>
		<div class="settingCard">
		<p class="headline">修改昵称&nbsp;<input type="text" id="nickName"
			name="nickName" value="${it.nickName}" /></p>
		</div>
		<div class="settingCard">
		<p class="headline">共享设置</p>
		<input type="radio" name="settings-share" value="0"
			<c:if test="${it.settingShare eq 0}">checked</c:if> />接受好友分享的电话<br>
		<input type="radio" name="settings-share" value="1"
			<c:if test="${it.settingShare eq 1}">checked</c:if> />不接受好友分享的电话<br>
		</div>
		<div class="settingCard">
		<p class="headline">隐私设置</p>
		<p>设置您的个人页面上的电话对其他用户的可见性（可见电话将能够被任何人查看和搜索到）：</p>
		<input type="radio" name="settings-privacy" value="0"
			<c:if test="${it.settingPrivacy eq 0}">checked</c:if> />我分享的电话对任何人可见<br>
		<input type="radio" name="settings-privacy" value="1"
			<c:if test="${it.settingPrivacy eq 1}">checked</c:if> />我分享的电话对任何人不可见<br>
		<input type="radio" name="settings-privacy" value="2"
			<c:if test="${it.settingPrivacy eq 2}">checked</c:if> />我的所有电话对任何人不可见，除非我特别设置<br>
		</div>
		<div class="settingCard">
		<p class="headline">同步设置</p>
		<p>选择执行手机同步时，同步哪些类型的电话：</p>
		<input type="checkbox" name="settings-sync" value="0"
			<c:if test="${fn:contains(it.settingSync,0)}">checked</c:if> />我分享的电话<br>
		<input type="checkbox" name="settings-sync" value="1"
			<c:if test="${fn:contains(it.settingSync,1)}">checked</c:if> />我订阅的电话<br>
		<input type="checkbox" name="settings-sync" value="2"
			<c:if test="${fn:contains(it.settingSync,2)}">checked</c:if> />好友分享的电话<br>
		</div>
		<div class="btnContainer"><input type="submit" value="保存" />
		<button id="cacel-settings">取消</button>
		</div>
		</form>
		</div>
		</td>
		<td>
		<div id="right"></div>
		</td>
	</tr>
</table>